/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2018-7-31
*
\*********************************************************************/

#ifndef SERIALPORT_QT_H
#define SERIALPORT_QT_H

#include <QSerialPort>
#include <QSerialPortInfo>
#include "CommBaseQt.h"

class SerialPortQt : public CommBaseQt
{
public:
    SerialPortQt(const std::string devName, QObject* parent = nullptr);
    ~SerialPortQt();
    bool SetOpt(qint32 baudRate, QSerialPort::FlowControl flowControl,QSerialPort::DataBits dataBits, QSerialPort::StopBits stopBits, QSerialPort::Parity parity);
    int Send(const unsigned char *sendBuf, const int dataLen) override;
    bool Open() override;
    void Close() override;
    QSerialPort m_portSer;
private:
    int Read(unsigned char * readbuf, const int dataLen) override;
};


#endif // SERIALPORT_QT_H

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/
